<!DOCTYPE html>
<html class="x-admin-sm">

{include file="common/static" /}
{include file="common/resources" /}
<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                <a>
                    <cite>黑名单</cite>
                </a>
            </span>
  <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
    <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
  </a>
</div>
<div class="layui-fluid">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
      <div class="layui-card">
        <div class="layui-card-body ">
          <form class="layui-form layui-col-space5" method="get" action="">
            <div class="layui-input-inline layui-show-xs-block">
              <input type="text" name="name" placeholder="请输入名称" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-input-inline layui-show-xs-block">
              <input type="text" name="identity" placeholder="请输入证据号码" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-input-inline layui-show-xs-block">
              <button class="layui-btn" lay-submit="" lay-filter="sreach">
                <i class="layui-icon">&#xe615;</i></button>
            </div>
          </form>
        </div>
        <div class="layui-card-header">
          <button class="layui-btn" onclick="xadmin.open('添加用户','/home/classe/adds',500,500)">
            <i class="layui-icon"></i>添加</button>
        </div>
        <div class="layui-card-body ">
          <table class="layui-table layui-form">
            <thead>
            <tr>
              <th>ID</th>
              <th>班次</th>
              <th>开始时间</th>
              <th>结束时间</th>
              <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {volist name="list" id="vo"}
            <tr>
              <td>{$vo.id}</td>
              <td>{$vo.classe}</td>
              <td>{$vo.start}</td>
              <td>{$vo.end}</td>
              <td class="td-manage">
                <a title="查看" onclick="xadmin.open('编辑','/home/classe/edits/id/'+{$vo.id},500,500)" href="javascript:;">
                  <i class="layui-icon">&#xe63c;</i></a>
                <a title="删除" onclick="member_del(this,{$vo.id})" href="javascript:;">
                  <i class="layui-icon">&#xe640;</i></a>
              </td>
            </tr>
            {/volist}
            </tbody>
          </table>
          {$list|raw}
        </div>
      </div>
    </div>
  </div>
</div>
</body>

<script>

  function member_del(obj, id) {
    layer.confirm('确认要删除吗？',
            function(index) {
              $.ajax({
                type:"post",
                url: "{:url('home/classe/deletes')}",
                data: {
                  id:id
                },
                success: function(data){
                  console.log(data);
                  toastr.error(data.msg);
                  if(data.code == 100){

                    layer.closeAll();
                    $(obj).parents("tr").remove();
                    setTimeout(function () {
                      location.reload();
                    },1000);
                  }
                }});
            });
  }
</script>


</html>